<?php

namespace app\api\validate;

use think\Validate;

class Privatechat extends Validate
{
    protected $rule = [
        ['content',      'require',                  '内容不能为空'],
        ['channel',      'number|in:1,2,3',            '类型有误|类型有误'],
        ['id',           'require|number|>:0',       '请先选择用户|请先选择用户|请先选择用户'],
        ['user_id',      'require|number|>:0',       '用户信息出错，请重新登陆|用户信息出错，请重新登陆|用户信息出错，请重新登陆'],
        ['to_user',      'require|number|>:0',       '无法获取到对方信息|无法获取到对方信息|无法获取到对方信息'],
        ['word_id',      'require|number|>:0',       '请先选择常用语|常用语错误|常用语错误'],
        ['page',         'number|>:0',               '当前页出错|当前页出错'],
        ['gift_id',      'number|>:0',               '礼物不存在|礼物不存在'],
        ['num',          'number|>:0',               '数量错误|数量错误'],
    ];

    protected $scene = [
        'commonWords'        => ['channel'],
        'addCommonWords'     => ['channel', 'content'],
        'delCommonWords'     => ['word_id', 'user_id'],
        'chat'               => ['id'],
        'detail'             => ['user_id', 'to_user'],
        'changeread'         => ['user_id', 'to_user'],
        'getMsgList'         => ['user_id', 'to_user', 'page'],
        'addtalk'            => ['gift_id', 'num'],
    ];
}
